#include<stdio.h>
void main(void)
{
    int n;
    int i=0;
    printf("请输入一个正整数\n");
    scanf("%d",&n);
    while(1)
    {
        if(n==4||n==2)
            break;
        if(n%2!=0)
        {
            n=(3*n+1);
            i++;
        }
        if(n%2==0)
        {
            n=n/2;
            i++;
        }
    }
    printf("变换次数为%d\n",i);
    
}